package com.im323.application;

import com.im323.dnspod.DnsPodErrorEnum;
import com.im323.dnspod.DnspodService;
import com.im323.dnspod.result.DnspodResult;
import com.im323.dnspod.result.DnspodUser;

public class IMDDNSUserController {

	public static DnspodUser getDnsPodUser() {
		DnspodResult<DnspodUser> dnspodResult = DnspodService.getUserDetail();
		if (dnspodResult.getStatus().getCode() != DnsPodErrorEnum.SUCCESS.getCode()) {
			System.out.println(dnspodResult.getStatus().getMessage());
			return null;
		}

		DnspodUser dnspodUser = dnspodResult.getInfo();
		if (dnspodUser == null) {
			System.out.println("没有查询到信息");
			return null;
		}

		return dnspodUser;
	}

}
